using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class ConsultantMap : EntityTypeConfiguration<Consultant>
    {
        public ConsultantMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.name)
                .HasMaxLength(50);

            this.Property(t => t.schoolname)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Consultant");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.schoolname).HasColumnName("schoolname");
            this.Property(t => t.isactive).HasColumnName("isactive");
        }
    }
}
